'''
Created on 2017年10月2日

@author: Administrator
'''

#列表生产器：if 多个for

if __name__ == '__main__':
    a=[x*x for x in range(1,11)]
    
    #相等与下面这个for循环的步骤
    
    L = []
    for x in range(1, 11):
        L.append(x * x)
        
        
    b=[x*x for x in range(1,11) if x%2==0]
    #    ==
    L = []
    for x in range(1, 11):
        if x%2==0:
            L.append(x * x)
    
    
    c=[n+m for n in "ABC" for m in "DFG"]
    # == 
    for n in "ABC":
        for m in "DFG":
            print(n+m,end=" ") 
    
    #练习
    L1 = ['Hello', 'World', 18, 'Apple', None]
    
    L2=[s.lower() for s in L1 if isinstance(s, str)]
    print(L2)
    